package com.test.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {
	private Object object;

	MyInvocationHandler(Object o) {
		this.object=o;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println(666);
		//method的主调
		method.invoke(object,args);
		System.out.println("after");
		return null;
	}
}
